package com.hxzy.shop.dto.convert;

import com.hxzy.shop.dto.req.AnnouncementReq;
import com.hxzy.shop.dto.resp.AnnouncementDetailResp;
import com.hxzy.shop.entity.Announcement;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Description
 * @Author tu-jia-hao
 * @Data 2022/7/4 17:54
 */
@Mapper
public interface AnnouncementConvert {
    public static AnnouncementConvert INSTANCE = Mappers.getMapper(AnnouncementConvert.class);

    AnnouncementDetailResp toAnnouncementDetail(Announcement announcement);
    @Mapping(target = "isDel",ignore = true)
    @Mapping(target = "createTime",ignore = true)
    Announcement toAnnouncement(AnnouncementReq req);
    AnnouncementDetailResp toAnnouncementDetailResp(Announcement announcement);

}
